import * as menu from '@/api/menu.js';
const state = {};
const mutations = {};
const getters = {};
const actions = {
	//小区活动列表
	goodList({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			menu.goodList(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//商品分类列表
	categoryList({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			menu.categoryList(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//在售的商品总数
	goodsCount({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			menu.goodsCount(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	//商品详情
	goodsDetail({ commit }, payload = {}) {
		return new Promise((resolve, reject) => {
			menu.goodsDetail(payload).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	}
};

export default { state, getters, mutations, actions };
